package com.workspaceapp;

import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

public class MyAdapter extends BaseExpandableListAdapter {

	private Context context;
	static String []parentList = {"Android", "Black"};
	static String []childList = {"ABCD" ,"IJKL"};
	
	public MyAdapter(Context context, String[] arrtit, String[] arrabs) {
		// TODO Auto-generated constructor stub
		this.context = context;
		MyAdapter.parentList = arrtit;
		MyAdapter.childList = arrabs;
	}

	@Override
	public Object getChild(int groupPosition, int childPosition) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getChildId(int groupPosition, int childPosition) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getChildView(int groupPosition, int childPosition,
			boolean isLastChild, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		TextView txt = new TextView(context);
		txt.setText(childList[groupPosition]);
		txt.setPadding(1, 1, 1, 1);
		txt.setTextSize(12);
		txt.setTextColor(Color.BLACK);
		return txt;
	}

	@Override
	public int getChildrenCount(int groupPosition) {
		// TODO Auto-generated method stub
		return 1;
	}

	@Override
	public Object getGroup(int groupPosition) {
		// TODO Auto-generated method stub
		return groupPosition;
	}

	@Override
	public int getGroupCount() {
		// TODO Auto-generated method stub
		return parentList.length;
	}

	@Override
	public long getGroupId(int groupPosition) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getGroupView(int groupPosition, boolean isExpanded,
			View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		TextView txt = new TextView(context);
		txt.setText(parentList[groupPosition]);
		txt.setPadding(1, 1, 0, 1);
		txt.setTextSize(14);
		txt.setTypeface(null,Typeface.BOLD);
		txt.setTextColor(Color.BLACK);
		return txt;

	}

	@Override
	public boolean hasStableIds() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isChildSelectable(int groupPosition, int childPosition) {
		// TODO Auto-generated method stub
		return true;
	}
	
	
	

}
